Skip to content

Conversation

Gescof
Copy link

@Gescof Gescof commented Jul 26, 2023

This PR intends to refactor key parts of the code to comply with JDK 17+ standards.
Specifically, these are the changes and explanation:

  • Usage of a logger @Sl4j tool instead of System class standard output.
  • Rename field token from Token entity to tokenCode and permission from Permission enum to permissionStr. This is to explicitly describe what is the property meaning since they should not have the same name as their class name.
  • Replace == null and != null with Objects.isNull and Objects.nonNull to follow functional programming approach.
  • Replace @Data annotation with @Getter @Setter @RequiredArgsConstructor @ToString and explicit equals hashCode methods. Using @Data for JPA entities is not recommended. It can cause severe performance and memory consumption issues because of lazy load with mapping entities.
  • Change Token properties visibility to private to be only accessed by their corresponding methods.
  • Make token property transient from User entity. See rule java:S1948.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant